package org.example.petitionplatformsystem.converter;

import org.example.petitionplatformsystem.dao.model.Approvals;
import org.example.petitionplatformsystem.dto.PetitionDTO.PetitionsAuditDTO;

import java.time.LocalDateTime;

public class PetitionAuditConverter {
    public static Approvals PAC(PetitionsAuditDTO PAD){
        Approvals approvals = new Approvals();
        approvals.setUserID(PAD.getUserId());
        approvals.setEventID(PAD.getEventId());
        if(PAD.getStatus() == 3)//如果审核通过
        {
            System.out.println("stusta  " + PAD.getStatus());
            approvals.setApprovalStatus("通过");
        }
        else
            approvals.setApprovalStatus("拒绝");
        approvals.setApprovalNotes(PAD.getApprovalNotes());
        approvals.setApprovalDate(LocalDateTime.now());
        return approvals;
    }
}
